package me.sdevil507.supports.status;

import me.sdevil507.biz.fruit.dto.ConstantAnnotation;

import java.lang.reflect.Field;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @program: tips_back_end
 * @description: 静态常量类管理
 * @author: kzl
 * @create: 2020-06-23 10:57
 **/
public  class ComConstant {

    public static final Map<String,Map<String,String>> keyValueMapCons = new LinkedHashMap<String, Map<String, String>>();

    public static final Map<String,Map<String,String>> keyDescMapCons = new LinkedHashMap<String, Map<String, String>>();

    public static final Map<String,Map<String,String>> descValueMapCons = new LinkedHashMap<String, Map<String, String>>();

    public static final Map<String,Map<String,String>> descKeyMapCons = new LinkedHashMap<String, Map<String, String>>();

    public static final Map<String,Map<String,String>> valueDescMapCons = new LinkedHashMap<String, Map<String, String>>();

    public static final Map<String,Map<String,String>> valueKeyMapCons = new LinkedHashMap<String, Map<String, String>>();

    /**
     * 初始化所有常量
     */
    static {
        try {
            //获取所有内部类
            for (Class cls : ComConstant.class.getClasses()) {
                //存放key和desc的map
                Map<String, String> keyDescMap = new LinkedHashMap<String, String>();
                //存放key和value的map
                Map<String, String> keyValueMap = new LinkedHashMap<String, String>();
                //存放value和key的map
                Map<String, String> valueKeyMap = new LinkedHashMap<String, String>();
                //存放value和desc的map
                Map<String, String> valueDescMap = new LinkedHashMap<String, String>();
                //存放desc和value的map
                Map<String, String> descValueMap = new LinkedHashMap<String, String>();
                //存放desc和key的map
                Map<String, String> descKeyMap = new LinkedHashMap<String, String>();


                //每个内部类-获取所有属性（不包括父类的）
                for (Field fd : cls.getDeclaredFields()) {
                    //每个属性获取指定的annotation的注解对象
                    ConstantAnnotation ca = fd.getAnnotation(ConstantAnnotation.class);
                    //注解对象空，其值为该field的值
                    keyValueMap.put(fd.getName(), fd.get(cls).toString());
                    valueKeyMap.put(fd.get(cls).toString(),fd.getName());
                    if(ca != null){
                        //注解对象不空，其值为注解对象中的值
                        keyDescMap.put(fd.getName(), ca.value());
                        valueDescMap.put(fd.get(cls).toString(),ca.value());
                        descValueMap.put(ca.value(),fd.get(cls).toString());
                        descKeyMap.put(ca.value(),fd.getName());
                    }
                }
                keyValueMapCons.put(cls.getSimpleName(),keyValueMap);
                keyDescMapCons.put(cls.getSimpleName(),keyDescMap);
                descValueMapCons.put(cls.getSimpleName(),descValueMap);
                descKeyMapCons.put(cls.getSimpleName(),descKeyMap);
                valueDescMapCons.put(cls.getSimpleName(),valueDescMap);
                valueKeyMapCons.put(cls.getSimpleName(),valueKeyMap);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 调用方法
     System.out.println(Constants.keyDescMapCons.get("TOKEN_FLAG_ONE").get("GUR"));
     **/

    public static final class FruitType{

        @ConstantAnnotation("连续性资料")
        public static final String  ContinuityInformation="1";

        @ConstantAnnotation("咨政内参")
        public static final String  InternalReferenceReport="2";

        @ConstantAnnotation("研究报告")
        public static final String  REPORT="3";

        @ConstantAnnotation("活动成果")
        public static final String  PolicyAdvice="4";

        @ConstantAnnotation("活动成果--出席会议")
        public static final String  MEETING="1";

        @ConstantAnnotation("活动成果--接待来访")
        public static final String  RECEIVE_VISITORS="2";

        @ConstantAnnotation("活动成果--考察调研")
        public static final String  SURVEY="3";

        @ConstantAnnotation("活动成果--授课培训")
        public static final String  TRAINING="4";

        @ConstantAnnotation("媒体成果")
        public static final String  NewspaperORNetwork="5";

        @ConstantAnnotation("媒体发文")
        public static final String  MEDIA_PUBLISHED_ARTICLES="10";

        @ConstantAnnotation("接受采访")
        public static final String  MEDIA_INTERVIEW="11";

        @ConstantAnnotation("学术论文")
        public static final String  Paper="6";

        @ConstantAnnotation("图书出版")
        public static final String  BOOK="7";

        @ConstantAnnotation("荣誉信息")
        public static final String  PRICE="8";

        @ConstantAnnotation("其他")
        public static final String  Other="9";

        @ConstantAnnotation("承担项目")
        public static final String  PROJECT="10";

        @ConstantAnnotation("承担项目--纵向")
        public static final String  VERTICAL="5";

        @ConstantAnnotation("承担项目--横向")
        public static final String  HORIZONTAL="6";

        @ConstantAnnotation("承担项目--省重点")
        public static final String  PROVINCEFOUCS="7";

        @ConstantAnnotation("承担项目--国家高端")
        public static final String  HIGHFOUCS="8";

        @ConstantAnnotation("承担项目--自设")
        public static final String  SELFSET="9";

    }

    public static final class FruitStatus{

        @ConstantAnnotation("待审核")
        public static final String  WATICHECK="0";

        @ConstantAnnotation("通过")
        public static final String  APPROVED="1";

        @ConstantAnnotation("拒绝")
        public static final String  REJECT="2";

        @ConstantAnnotation("已经存在")
        public static final String  EXISTED="3";
    }

    public static final class TopicApplyRecordStatus{

        @ConstantAnnotation("取消")
        public static final String  CANCEL="0";

        @ConstantAnnotation("确定")
        public static final String  APPLY="1";

        @ConstantAnnotation("通过")
        public static final String  APPROVED="2";

        @ConstantAnnotation("拒绝")
        public static final String  REJECT="999";
    }

    public static final class OpenType{

        @ConstantAnnotation("公开")
        public static final String  OPEN="1";

        @ConstantAnnotation("指派")
        public static final String  ASSIGN="2";

    }

    public static final class ProjectType{

        @ConstantAnnotation("省重点智库课题")
        public static final String PROVINCEFOCUS = "1";

        @ConstantAnnotation("纵向课题")
        public static final String VERTICAL = "2";

        @ConstantAnnotation("横向课题")
        public static final String HORIZONTAL = "3";

        @ConstantAnnotation("自设课题")
        public static final String SELFSET = "4";

        @ConstantAnnotation("国家高端智库年度重点课题")
        public static final String HIGHFOCUS = "5";

    }

    public static final class ProjectStatus{

        @ConstantAnnotation("立项开题")
        public static final String  START="1";

        @ConstantAnnotation("课题在研")
        public static final String  RESEARCH="2";

//        @ConstantAnnotation("报告修改")
//        public static final String  REPORTMODIFY="3";

        @ConstantAnnotation("验收结项")
        public static final String  COMPLETE="4";

        @ConstantAnnotation("完结")
        public static final String  FINISHED="6";

    }

    public static final class TopicStatus{

        @ConstantAnnotation("草稿")
        public static final String  CANCEL="0";

        @ConstantAnnotation("待领取")
        public static final String  UNCLAIMED="1";

        @ConstantAnnotation("进行中")
        public static final String  HAVE_IN_HAND="2";

        @ConstantAnnotation("已完成")
        public static final String  COMPLETE="3";

    }

    /**
     * 审核状态  0 待审核 1审核中  2发布  999退稿
     */
    public static final class ManuscriptStatus{

        @ConstantAnnotation("待审核")
        public static final String  CHECKPENDING="0";

        @ConstantAnnotation("审核中")
        public static final String  INREVIEW="1";

        @ConstantAnnotation("发布")
        public static final String  RELEASE="2";

        @ConstantAnnotation("退稿")
        public static final String  REJECTION="999";

    }

    /**
     * 审核状态  0 待审核  1验证通过  2 未验证通过
     */
    public static final class TempExpertCheckStatus{

        @ConstantAnnotation("待验证")
        public static final String  CHECKPENDING="0";

        @ConstantAnnotation("验证通过")
        public static final String  PASSED="1";

        @ConstantAnnotation("验证失败")
        public static final String  FAILED="2";

    }

    /**
     * 审核状态  0 待响应  1同意  2 拒绝
     */
    public static final class ManInvitationStatus{

        @ConstantAnnotation("待响应")
        public static final String  NORESPONSE="0";

        @ConstantAnnotation("同意")
        public static final String  APPROVED="1";

        @ConstantAnnotation("拒绝")
        public static final String  REJUECT="2";
    }

    /**
     * 审核状态  1.时事通讯  2内参  3其他
     */
    public static final class PublicationType{

        @ConstantAnnotation("时事通讯")
        public static final String  Newsletters="1";

        @ConstantAnnotation("内参")
        public static final String  InternalReference="2";

        @ConstantAnnotation("其他")
        public static final String  others="3";
    }

    /**
     * 审核状态  1.时事通讯  2内参  3其他
     */
    public static final class PubCycle{

        @ConstantAnnotation("日")
        public static final String  day="1";

        @ConstantAnnotation("周")
        public static final String  week="2";

        @ConstantAnnotation("旬")
        public static final String  TenDays="3";

        @ConstantAnnotation("半月")
        public static final String  halfamonth="4";

        @ConstantAnnotation("月")
        public static final String  month="5";

        @ConstantAnnotation("双月")
        public static final String  twomonth="6";

        @ConstantAnnotation("季")
        public static final String  threemonth="7";

        @ConstantAnnotation("半年")
        public static final String  halfayear="8";

        @ConstantAnnotation("年")
        public static final String  year="9";

        @ConstantAnnotation("双年")
        public static final String  twoyear="10";

        @ConstantAnnotation("其他")
        public static final String  others="11";
    }

    public static final class ActivityType{

        @ConstantAnnotation("内部会议")
        public static final String  MEETING="1";

        @ConstantAnnotation("采访活动-2")
        public static final String  INTERVIEW="2";

        @ConstantAnnotation("学术论坛-3")
        public static final String  FORUM="3";
    }

    public static final class PubLevel{

        @ConstantAnnotation("国家级")
        public static final String  COUNTRY="1";

        @ConstantAnnotation("省级")
        public static final String  PROVINCE="2";

        @ConstantAnnotation("市级")
        public static final String  CITY="3";

        @ConstantAnnotation("没有刊登")
        public static final String  NOT_PUBLISHED="4";
    }

    /**批示倾向**/
    public static final class Inclinations{

        @ConstantAnnotation("肯定")
        public static final String  SURE="1";

        @ConstantAnnotation("否定")
        public static final String  NEGATIVE="2";

    }

    /**批示级别**/
    public static final class InclinationsLevel{

        @ConstantAnnotation("正国级")
        public static final String  COUNTRY_LEVEL ="1";

        @ConstantAnnotation("副国级")
        public static final String  DEPUTY_COUNTRY_LEVEL="2";

        @ConstantAnnotation("正部级")
        public static final String  DEPARTMENT_LEVEL="3";

        @ConstantAnnotation("副部级")
        public static final String  DEPUTY_DEPARTMENT_LEVEL="4";

        @ConstantAnnotation("正厅级")
        public static final String  HALL_LEVEL="5";

        @ConstantAnnotation("副厅级")
        public static final String  DEPUTY_HALL_LEVEL="6";

    }

    /**来源**/
    public static final class ReportSource{

        @ConstantAnnotation("课堂产生")
        public static final String  BY_TOPIC="1";

        @ConstantAnnotation("单独生成")
        public static final String  Alone="2";

    }

    /**期刊类型**/
    public static final class JournalType{

        @ConstantAnnotation("CSSCI")
        public static final String  CSSCI="1";

        @ConstantAnnotation("CSCI")
        public static final String  CSCI="2";

        @ConstantAnnotation("SCI/EI/ISTP")
        public static final String  SCI_EI_ISTP="3";

        @ConstantAnnotation("CSCD")
        public static final String  CSCD="4";

    }


    /**期刊类型**/
    public static final class BookType{

        @ConstantAnnotation("工具书")
            public static final String REFERENCE_BOOK="1";

        @ConstantAnnotation("专著")
        public static final String  MONOGRAPH="2";

        @ConstantAnnotation("编著")
        public static final String  EDITOR="3";

        @ConstantAnnotation("译著")
        public static final String  TRANSLATED_WORKS="4";

        @ConstantAnnotation("教材")
        public static final String  TEACHING_MATERIAL="5";

    }

    /**期刊类型**/
    public static final class AwardLevel {

        @ConstantAnnotation("国际级")
        public static final String INTERNATIONAL = "1";

        @ConstantAnnotation("国家级")
        public static final String  COUNTRY="2";

        @ConstantAnnotation("省级")
        public static final String  PROVINCE="3";

        @ConstantAnnotation("地级")
        public static final String  CITY="4";
    }

    /**活动类型**/
    public static final class ProductionActivityType {

        @ConstantAnnotation("1")
        public static final String MEETING = "出席会议";

        @ConstantAnnotation("2")
        public static final String  INTERVIEW = "接受采访";

        @ConstantAnnotation("3")
        public static final String  SURVEY = "考察调研";

        @ConstantAnnotation("4")
        public static final String  TRAINING = "授课培训";
    }


    /**刊载媒体**/
    public static final class MediaType {

        public static final String PEOPLEDAILY = "人民日报";
        public static final String GUANGMINGDAILY = "光明日报";
        public static final String ECONOMICDAILY = "经济日报";
        public static final String CHINESESOCIALDAILY = "中国社会科学报";
        public static final String SEEKING = "求是内参";

    }


    /**
     * 附件类型(一对多使用类型区分)
     */
    public static final class AttFileType{

        @ConstantAnnotation("专报")
        public static final String SPECIALREPORT = "100";

        @ConstantAnnotation("课题-立项开题")
        public static final String KT_LXKT = "21";

        @ConstantAnnotation("课题-立项开题其它材料")
        public static final String KT_LXKTOTHER = "22";

        @ConstantAnnotation("课题-验收报告")
        public static final String KT_YSBG = "23";

        @ConstantAnnotation("课题-简况表")
        public static final String KT_JKB = "24";

        @ConstantAnnotation("课题-简版报告")
        public static final String KT_JBBG = "25";

        @ConstantAnnotation("课题-提交验收其它材料")
        public static final String KT_TJYSOTHER = "26";

        @ConstantAnnotation("文件上报-简报")
        public static final String WJSB_JBSC = "31";

        @ConstantAnnotation("文件上报-论坛备案")
        public static final String WJSB_LTBA = "32";

        @ConstantAnnotation("考核材料-智库工作总结")
        public static final String KHCL_GZZJ = "41";

        @ConstantAnnotation("考核材料-省重点智库自评报告")
        public static final String KHCL_ZPBG = "42";

        @ConstantAnnotation("考核材料-评估支撑材料汇编word版本")
        public static final String KHCL_ZCCL_WORD = "43";

        @ConstantAnnotation("考核材料-评估支撑材料汇编pdf版本")
        public static final String KHCL_ZCCL_PDF = "44";

        @ConstantAnnotation("考核材料-I1&G1-智库职员信息采集表")
        public static final String KHCL_ZYCJ = "45";

        @ConstantAnnotation("考核材料-D-智库决策咨询类信息采集表")
        public static final String KHCL_JCZX = "46";

        @ConstantAnnotation("考核材料-T-理论创新和舆论引导信息采集表")
        public static final String KHCL_LLCX = "47";

        @ConstantAnnotation("考核材料-江苏省重点智库自评表")
        public static final String KHCL_ZPB = "48";

    }

    /**中央及国家部委**/
    public static final class nationalCenterType {

        public static final String NATIONALCENTER = "中宣部、工信部、中央办公厅、中国人民银行、国家发改委";

    }

    /**省市级**/
    public static final class provinceCityType {

        public static final String provinceCity = "上海市委、上海市政府、江苏省委、江苏省政府、江苏省委宣传部、苏州市委、苏州市政府、南京市委、南京市政府";

    }

    /**专报部门名称**/
    public static final class specialDeptName {

        public static final String JSSWXCB = "江苏省委宣传部";

    }

    /**日志终端**/
    public static final class LogSource {

        @ConstantAnnotation("平台端")
        public static final String PLATFORM = "1";

        @ConstantAnnotation("消费端")
        public static final String SERVICES="2";

        @ConstantAnnotation("机构端")
        public static final String ORGANIZATION="3";

        @ConstantAnnotation("专家端")
        public static final String EXPERT="4";
    }

    /**日志类型**/
    public static final class LogType {

        @ConstantAnnotation("成果")
        public static final String PRODCTIONS = "1";

        @ConstantAnnotation("课题")
        public static final String TOPIC="2";
    }

    /**日志操作**/
    public static final class LogOperate {

        @ConstantAnnotation("查看成果")
        public static final String VIEWDETAIL_PROD = "1";

        @ConstantAnnotation("索要成果")
        public static final String GET_PROD="2";
    }

    /**模块类型**/
    public static final class ModuleType {

        @ConstantAnnotation("节点")
        public static final Integer MODULE_NODE = 0;

        @ConstantAnnotation("菜单")
        public static final Integer MODULE_MENU = 1;

        @ConstantAnnotation("按钮")
        public static final Integer MODULE_BUTTON = 2;
    }

    /**模块分类**/
    public static final class ModuleClassify {

        @ConstantAnnotation("基础")
        public static final Integer BASIC_MODULE = 1;

        @ConstantAnnotation("增值")
        public static final Integer VALUE_MODULE = 2;
    }

    /**模块端口分类**/
    public static final class ModuleTerminal {

        @ConstantAnnotation("平台端")
        public static final int PLATFORM = 1;

        @ConstantAnnotation("消费端")
        public static final int SERVICES = 2;

        @ConstantAnnotation("机构端")
        public static final int ORGANIZATION = 3;

        @ConstantAnnotation("专家端")
        public static final int EXPERT = 4;
    }

    /**模块端口服务**/
    public static final class ModuleService {

        @ConstantAnnotation("系统管理")
        public static final int PLATFORM = 0;

        @ConstantAnnotation("智库管理")
        public static final int ORGANIZATION = 1;

        @ConstantAnnotation("专家管理")
        public static final int EXPERT = 2;

        @ConstantAnnotation("课题管理")
        public static final int PROJECT = 3;

        @ConstantAnnotation("其他工具")
        public static final int TOOL = 4;
    }

    /**附件上传类型**/
    public static final class UploadType {

        @ConstantAnnotation("阿里云")
        public static final Integer ALIYUN = 1;

        @ConstantAnnotation("本地存储")
        public static final Integer NFSDISK = 2;
    }

    /**附件上传所属业务**/
    public static final class UploadBusinessType {

        @ConstantAnnotation("成果管理")
        public static final int FRUIT = 1;

        @ConstantAnnotation("课题管理")
        public static final int PROJECT = 2;
    }

}
